home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / log.h.z / log.h
C/C++ Source or Header  |  1992-04-03  |  2KB  |  86 lines

  1. /*    Copyright (c) 1984 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*#ident    "@(#)kern-port:sys/log.h    10.1"*/
  9. #ident    "$Revision: 3.2 $"
  10. /*
  11.  * Header file for the Streams Log Driver
  12.  */
  13.  
  14. struct log {
  15.     unsigned log_state;
  16.     queue_t *log_rdq;
  17.     int     log_bcnt;
  18. };
  19.  
  20. /*
  21.  * Driver state values.
  22.  */
  23. #define LOGOPEN     01
  24.  
  25. /* 
  26.  * Module information structure fields
  27.  */
  28. #define LOG_MID        44
  29. #define LOG_NAME    "LOG"
  30. #define LOG_MINPS    0
  31. #define LOG_MAXPS    512
  32. #define LOG_HIWAT    512
  33. #define LOG_LOWAT    256
  34.  
  35. extern strlog();
  36.  
  37. extern struct log log_log[];        /* sad device state table */
  38. extern int log_cnt;            /* number of configured minor devices */
  39. extern int log_bsz;            /* size of internal buffer of log messages */
  40.  
  41. /*
  42.  * STRLOG(mid,sid,level,flags,fmt,args) should be used for those trace
  43.  * calls that are only to be made during debugging.
  44.  */
  45. #ifdef DEBUG
  46. #define STRLOG    strlog
  47. #else
  48. #define STRLOG
  49. #endif
  50.  
  51.  
  52. /*
  53.  * Utility macros for strlog.
  54.  */
  55.  
  56. /*
  57.  * logadjust - move a character pointer up to the next int boundary
  58.  * after its current value.  Assumes sizeof(int) is 2**n bytes for some integer n. 
  59.  */
  60. #define logadjust(wp) (char *)(((unsigned)wp + sizeof(int)) & ~(sizeof(int)-1))
  61.  
  62. /*
  63.  * logstrcpy(dp, sp) copies string sp to dp.
  64.  */
  65.  
  66. #ifdef u3b2
  67. asm     char *
  68. logstrcpy(dp, sp) 
  69. {
  70. %    reg s1, s2;
  71.  
  72.     MOVW s1,%r0
  73.     MOVW s2,%r1
  74.     STRCPY
  75.     MOVW %r0,s1
  76.     MOVW %r1,s2
  77. }
  78. #else
  79.     /*
  80.      * This is a catchall definition for those processors that have not had
  81.      * this coded in assembler above.
  82.      */
  83. #    define logstrcpy(dp, sp)  for (; *dp = *sp; dp++, sp++)
  84. #endif
  85.     
  86.